package com.itheima.properties;

import com.baidu.aip.face.AipFace;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;

//配置人脸识别功能 配置类
@Data
@ConfigurationProperties("tanhua.aip")
public class AipFaceProperties {
    //获得百度智能云的 人脸识别功能 AppID
    private String appId;
    //获得API Key
    private String apiKey;
    //Secret Key
    private String secretKey;

    //封装人脸识别功能被包扫描
    @Bean
    public AipFace aipFace(){
        AipFace aipFace = new AipFace(appId, apiKey, secretKey);
        // 可选：设置网络连接参数
        aipFace.setConnectionTimeoutInMillis(2000);
        aipFace.setSocketTimeoutInMillis(6000);
        return aipFace;
    }

}
